#pragma once


#include <string>
#include <sstream>
#include "../SQLExpr.h"
#include "../SQLExprImpl.h"

class SQLASTVisitor;

class SQLVariantRefExpr : virtual public SQLExprImpl
{

private:
	string_ptr name;

	BOOL_ptr global;
	BOOL_ptr session;

	int index;

public:
  static string_ptr class_;
	SQLVariantRefExpr(string_ptr name);
	SQLVariantRefExpr(const char *x);
	virtual ~SQLVariantRefExpr();
  SHAREDOBJECT(SQLVariantRefExpr);

	SQLVariantRefExpr(string_ptr name, BOOL_ptr global);
	SQLVariantRefExpr(string_ptr name, BOOL_ptr global, BOOL_ptr session);
	SQLVariantRefExpr(string_ptr name, SQLObject_ptr parent);

	SQLVariantRefExpr();

	int getIndex();

	void setIndex(int index);

	string_ptr getName();

	void setName(string_ptr name);

	void output(std::stringstream *  buf);

	// int hashCode();
	// BOOL_ptr equals(Object obj);
	BOOL_ptr isGlobal();
	void setGlobal(BOOL_ptr global);

protected:
	void accept0(SQLASTVisitor_ptr visitor);
};

